home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / CBASE102.ARJ / BTINST.BAT < prev    next >
DOS Batch File  |  1991-09-23  |  6KB  |  153 lines

  1. @echo off
  2. rem btree installation batch file-----------------------------------------------
  3. rem btinst.bat    1.5 - 91/09/23
  4.  
  5. rem ----------------------------------------------------------------------------
  6. rem NAME
  7. rem      install.bat - btree library installation batch file for DOS
  8. rem
  9. rem SYNOPSIS
  10. rem      install model [x]
  11. rem
  12. rem DESCRIPTION
  13. rem     install.bat performs the installation of the btree library for
  14. rem     DOS.  model specifies the memory model as one of the following.
  15. rem
  16. rem          S        small model
  17. rem          M        medium model
  18. rem          C        compact model
  19. rem          L        large model
  20. rem          H        huge model
  21. rem
  22. rem     The library file is named Mbtree.lib, where M would correspond
  23. rem     to the memory model of the library.
  24. rem
  25. rem     If specified, the second parameter causes the reference manual to
  26. rem     be extracted from the source code.  The reference manual is placed
  27. rem     in the file btree.man.
  28. rem
  29. rem SEE ALSO
  30. rem      makefile
  31. rem
  32. rem NOTES
  33. rem      This batch file is written for use with Microsoft C.  To convert
  34. rem      it for use with another compiler, make the following
  35. rem      modifications:
  36. rem           1. Replace \usr\include with the include directory used by
  37. rem              the new compiler.
  38. rem           2. Replace \usr\lib with the library directory used by the
  39. rem              new compiler.
  40. rem           3. Replace cl with the command to invoke the compiler being
  41. rem              used, replacing the switches also, if necessary.  Below
  42. rem              are listed the Microsoft C switches used and their
  43. rem              meanings.
  44. rem                   -c        compile but don't link
  45. rem                   -Oalt     optimization
  46. rem                             a - relax alias checking
  47. rem                             l - enable loop optimization
  48. rem                             t - favor execution speed
  49. rem                   -Za       ANSI keywords only
  50. rem                   -A        memory model
  51. rem           4. The command to build the library archive from the object
  52. rem              modules may vary more drastically.  Microsoft C uses the
  53. rem              lib command with what is called a response file.  This
  54. rem              response file, btree.rsp, contains a list of all the
  55. rem              object modules in the library.
  56. rem
  57. rem ----------------------------------------------------------------------------
  58.  
  59. rem verify arguments------------------------------------------------------------
  60. if "%1" == "S" goto arg1
  61. if "%1" == "M" goto arg1
  62. if "%1" == "C" goto arg1
  63. if "%1" == "L" goto arg1
  64. if "%1" == "H" goto arg1
  65. echo usage:  install model [x]
  66. echo Valid values for model are S (small), M (medium), C (compact),
  67. echo   L (large), and H (huge).  Model must be upper case.
  68. echo If x is specified, the reference manual will be extracted.
  69. goto end
  70. :arg1
  71.  
  72. if "%2" == "" goto arg2
  73. if "%2" == "x" goto arg2
  74. echo usage:  install model [x]
  75. echo Invalid second argument.  Valid value is lowercase x.
  76. goto end
  77. :arg2
  78.  
  79. if "%3" == "" goto arg3
  80. echo usage:  install model [x]
  81. echo Too many arguments specified.
  82. goto end
  83. :arg3
  84.  
  85. rem check if blkio installed----------------------------------------------------
  86. if exist \usr\include\blkio.h goto blkio
  87. echo The blkio library must be installed first.
  88. goto end
  89. :blkio
  90.  
  91. rem extract the reference manual------------------------------------------------
  92. if not "%2" == "x" goto skipman
  93. echo Extracting reference manual into btree.man.
  94. if not exist btree.man goto man
  95. echo btree.man exists.  ^C to exit, any other key to continue.
  96. pause
  97. :man
  98. if not exist tmp goto tmp
  99. echo tmp exists.  ^C to exit, any other key to continue.
  100. pause
  101. :tmp
  102. echo on
  103. type btree.h | manx -c > btree.man
  104. copy btclose.c/a+btcreate.c+btcursor.c+btdelcur.c+btdelete.c+btfirst.c tmp
  105. type tmp | manx -c >> btree.man
  106. copy btfix.c/a+btgetcur.c+btgetk.c+btgetlck.c+btinsert.c+btkeycmp.c tmp
  107. type tmp | manx -c >> btree.man
  108. copy btkeycnt.c/a+btkeysiz.c+btlast.c+btlock.c+btnext.c+btopen.c tmp
  109. type tmp | manx -c >> btree.man
  110. copy btprev.c/a+btsearch.c+btsetbuf.c+btsetcur.c+btsetvbu.c+btsync.c tmp
  111. type tmp | manx -c >> btree.man
  112. del tmp
  113. @echo off
  114. :skipman
  115.  
  116. rem compile all btree source files----------------------------------------------
  117. echo on
  118. cl -c -Oalt -Za -A%1 btclose.c  btcreate.c btdelcur.c btdelete.c btfirst.c  btfix.c
  119. cl -c -Oalt -Za -A%1 btgetcur.c btgetk.c   btgetlck.c btinsert.c btkeycmp.c btlast.c
  120. cl -c -Oalt -Za -A%1 btlock.c   btnext.c   btopen.c   btprev.c   btsearch.c btsetbuf.c
  121. cl -c -Oalt -Za -A%1 btsetcur.c btsetvbu.c btsync.c
  122. cl -c -Oalt -Za -A%1 btops.c    dgops.c    kyops.c    ndops.c
  123. @echo off
  124.  
  125. rem build the btree library archive---------------------------------------------
  126. if exist %1btree.lib del %1btree.lib
  127. echo on
  128. lib %1btree @btree.rsp
  129. @echo off
  130.  
  131. rem install the btree library---------------------------------------------------
  132. if not exist \usr\include\btree.h goto h
  133. echo \usr\include\btree.h exists.  ^C to exit, any other key to continue.
  134. pause
  135. :h
  136. echo on
  137. copy btree.h \usr\include\btree.h
  138. @echo off
  139.  
  140. if not exist \usr\lib\%1btree.lib goto lib
  141. echo \usr\lib\%1btree.lib exists.  ^C to exit, any other key to continue.
  142. pause
  143. :lib
  144. echo on
  145. copy %1btree.lib \usr\lib\%1btree.lib
  146. @echo off
  147.  
  148. rem make btdemo program---------------------------------------------------------
  149. cl -Oalt -Za -A%1 btdemo.c %1btree.lib %1blkio.lib
  150.  
  151. rem end of btree installation batch file----------------------------------------
  152. :end
  153.